// Copyright (c) 2020 Presto Labs Pte. Ltd.
// Author: leon

#include "coin2/exchange/bitflyer_futures/symbology/currency.h"

#include <gtest/gtest.h>

TEST(BitflyerCurrency, constructor) {
  using namespace coin2::exchange::bitflyer_futures::symbology;
  using coin2::exchange::base::market::ExchangeType;
  using coin2::exchange::base::market::MarketType;

  int64_t resolve_ts = 1572502253 * 1e9;

  BitflyerCurrency jpy("JPY");
  EXPECT_EQ(jpy.currency(), "JPY");
  EXPECT_EQ(jpy.native_currency(MarketType::Futures), "JPY");
  EXPECT_EQ(jpy.native_currency(MarketType::Spot), "JPY");
  EXPECT_EQ(jpy.rep_currency(), "JPY");
  EXPECT_EQ(jpy.exchange(), ExchangeType::Bitflyer);

  auto btc1 = BitflyerCurrency::FromNativeStr("BTC", resolve_ts);
  EXPECT_EQ(btc1.currency(), "BTC");
  EXPECT_EQ(btc1.native_currency(MarketType::Spot), "BTC");
  EXPECT_EQ(btc1.native_currency(MarketType::Futures), "BTC");
  EXPECT_EQ(btc1.exchange(), ExchangeType::Bitflyer);

  auto btc2 = BitflyerCurrency::FromNormStr("BTC", resolve_ts);
  auto btc3 = BitflyerCurrency::FromStr("BTC", resolve_ts);
  EXPECT_EQ(btc2, btc1);
  EXPECT_EQ(btc3, btc1);
}
